import { Component, OnInit } from '@angular/core';
import { HttpClient} from '@angular/common/http';
import { ActivatedRoute} from '@angular/router';

@Component({
  selector: 'app-introduce',
  templateUrl: './introduce.component.html',
  styleUrls: ['./introduce.component.scss']
})
export class IntroduceComponent implements OnInit {
public goodlist: any;
public key: any;
  constructor( public http: HttpClient, public router: ActivatedRoute) { }

  ngOnInit() {
    this.router.queryParams.subscribe((result: any) => {
      console.log(result);
      this.key = result.key;
    } );
    const pi = 'http://192.168.2.228:8080/goods/list';
    this.http.get(pi).subscribe((respnse: any) => {
      console.log(respnse.data.list);
      this.goodlist = respnse.data.list;
      console.log(this.goodlist);
    });
  }

}
